package com.htl.线程;

/**
 *  静态的 synchronized方法
 */

public class Test5 {
    public static void main(String[] args) {
        for (int i = 0; i < 5; i++) {
            Thread thread = new Thread(() -> {

//                Test5 test5 = new Test5();
//                test5.test();

                Test5.test();

            });
            thread.start();
        }
    }

    public synchronized static void test(){
        System.out.println("start.....");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("end.......");
    }

}

